package com.delivery.mapper;

import com.delivery.anno.AutoFill;
import com.delivery.dto.CategoryPageQueryDTO;
import com.delivery.entity.Category;
import com.delivery.enumeration.OperationType;
import com.github.pagehelper.Page;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

@Mapper
public interface CategoryMapper {

    //根据id更新分类
    @AutoFill(OperationType.UPDATE)
    void updateCategory(Category category);

    //分页查询
    Page<Category> categoryPageSelect(CategoryPageQueryDTO dto);

    //添加分类
    @AutoFill(OperationType.INSERT)
    void insertCategory(Category category);

    void deleteCategory(Long id);

    List<Category> selectCategoriesByType(Integer type);

}
